package demoMod.nanaki.patches;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import demoMod.anm2player.AnimatedActor;
import demoMod.nanaki.stances.AbstractStrophe;

public class AbstractPlayerPatch {
    @SpirePatch(
            clz = AbstractPlayer.class,
            method = "update"
    )
    public static class PatchUpdate {
        public static void Postfix(AbstractPlayer player) {
            for (AnimatedActor actor : AbstractStrophe.vfxList) {
                actor.update();
            }
        }
    }

    @SpirePatch(
            clz = AbstractPlayer.class,
            method = "render"
    )
    public static class PatchRender {
        public static void Postfix(AbstractPlayer player, SpriteBatch sb) {
            for (AnimatedActor actor : AbstractStrophe.vfxList) {
                actor.render(sb);
            }
        }
    }

    @SpirePatch(
            clz = AbstractPlayer.class,
            method = "onVictory"
    )
    public static class PatchOnVictory {
        public static void Postfix(AbstractPlayer player) {
            for (AnimatedActor actor : AbstractStrophe.vfxList) {
                actor.setCurAnimation("exit");
            }
        }
    }
}
